package com.sys.app.entity.result;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.sys.app.entity.emum.ResultEnum;

import java.util.List;

public  class PageResultDTO<T> {
    private long total;
    private List<T> rows;
    public PageResultDTO(){}

    public long getTotal() {
        return total;
    }

    public void setTotal(long total) {
        this.total = total;
    }

    public List<T> getRows() {
        return rows;
    }

    public void setRows(List<T> rows) {
        this.rows = rows;
    }

    public  PageResultDTO result(IPage<T> page) {
        this.setTotal(page.getTotal());
        this.setRows(page.getRecords());
        return this;
    }


}
